package com.jia.order.controller;


import com.jia.order.client.UserClient;
import com.jia.order.pojo.Orders;
import com.jia.order.pojo.User;
import com.jia.order.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 陈佳
 * @since 2024-08-28
 */
@RestController
@RequestMapping("/order")
public class OrdersController {

    @Autowired
    private OrdersService ordersService;

    @Autowired
    private UserClient userClient;

    @GetMapping("/getOrderAndUser")
    public Orders getOrderAndUser() {
        Orders orders = ordersService.getOrderAndUser();
        User user = userClient.findUserById(11L);
        System.out.println(user);
        return orders;
    }
}

